﻿using System;
using System.Collections.Generic;
using System.Linq;
using BusinnesLogic.ServerObjects;


namespace ConsoleTest
{
    public class Program
    {
        public static void Main(string[] args)
        {

            SqlServer sqlServer = new SqlServer(@"localhost\DELLSQLSERVER", "testuser", "testuser");

            Console.WriteLine("Database name: " + sqlServer.Databases[0].Name);
            Console.WriteLine("Tables:");

            foreach(SqlTable table in sqlServer.Databases[0].Tables)
            {
                Console.WriteLine("-> Name :" + table.Name + " -ID: " + table.ID + " - Row count: " + table.RowCount);
                
                Console.WriteLine("Columns:");
                foreach (SqlColumn column in table.Columns)
                {
                    Console.WriteLine("-> Name :" + column.Name);
                }

            }

            Console.ReadLine();
        }
    }
}
